<template>
  <div class="privilege">
    <van-nav-bar title="我的收藏" left-arrow @click-left="back"/>
    <ul class="navlist">
      <li>
        单品
        <div class="nav_line active"></div>
      </li>
      <li>
        设计师
        <div class="nav_line"></div>
      </li>
      <li>
        其他
        <div class="nav_line"></div>
      </li>
    </ul>
    <div class="content bingo">
      <div class="img_wrapper">
          <img src="../assets/cprod.png" alt="">
      </div>
    </div>
    <div class="content">
        <div class="img_wrapper">
          <img src="../assets/cperson.png" alt="">
        </div>
    </div>
    <div class="content">
        <div class="img_wrapper">
          <img src="../assets/cother.png" alt="">
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "myprivilege",
  data() {
    return {
      activeName: "a",
      flag:false,
    };
  },
  methods: {
    back() {
      this.$router.go(-1);
    },
    show(){
        this.flag = !this.flag;
    }
  },
  mounted() {
    var num = document.getElementsByClassName("navlist")[0].children.length;
    for (let i = 0; i < num; i++) {
      document.getElementsByClassName("navlist")[0].children[i].onclick = function() {
        for (var j = 0; j < num; j++) {
          document
            .getElementsByClassName("navlist")[0]
            .children[j].children[0].setAttribute("class", "nav_line");
          document
            .getElementsByClassName("content")
            [j].setAttribute("class", "content");
        }
        this.children[0].setAttribute("class", "nav_line active");
        document
          .getElementsByClassName("content")
          [i].setAttribute("class", "content bingo");
      };
    }
  }
};
</script>

<style scoped>
.van-icon {
  color: #333;
  font-size: 36px;
}
.van-ellipsis{
    font-size:30px;
}
.navlist {
  height: 80px;
  /* overflow: hidden; */
}
.navlist li {
  float: left;
  line-height: 80px;
  font-size: 30px;
  width: 33.3333%;
  text-align: center;
  color: #666;
}
.nav_line {
  width: 90px;
  height: 5px;
  background: rgba(0, 0, 0, 1);
  margin: -10px auto;
  display: none;
  transition: 0.3s opacity;
}
.active {
  display: block;
}
.content {
  display: none;
}
.bingo {
  display: block;
}
.img_wrapper{
    padding-bottom: 230px;
    padding-top: 200px!important;
    width: 341px;
    height: 341px;
    margin: 0 auto;
}
.img_wrapper img{
    width: 100%;
}
.introduce{
    padding: 30px 33px;
    background: #fff;
    box-sizing: border-box;
}
.introduce h1{
    font-size: 35px;
    line-height: 1;
    padding-bottom: 30px;
    color: #2b2b2b;
    text-align: left;
    position: relative;
    margin: 0;
}
.introduce h1::after{
    content: '';
    width: 109.5%;
    height: 2px;
    position: absolute;
    left: -33px;
    bottom: 0;
    z-index: 2;
    background: #acacac;
}
.introduce p{
    font-size: 27px;
    line-height:42px;
    margin-bottom: 0;
}
.introduce p a{
    color: #333;
}

</style>